home *** CD-ROM | disk | FTP | other *** search
- Path: yama.mcc.ac.uk!liv!strath-cs!pcallagh
- From: pcallagh@cs.strath.ac.uk (Paul Callaghan)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Random #s
- Date: 21 Mar 1996 14:03:20 GMT
- Organization: Computer Science Dept., Strathclyde University., Glasgow, Scotland.
- Sender: pcallagh@cs.strath.ac.uk (Paul Callaghan CS94)
- Distribution: world
- Message-ID: <4irnj8$a2t@dunlop.cs.strath.ac.uk>
- References: <4ihkif$ed0@apollo.isisnet.com>
- NNTP-Posting-Host: lister-01.cs.strath.ac.uk
-
- Here is a little program which will generate random numbers
- (Off the top of my head so it `should` work.)
- (rand() % MUTATE)+
- #include <time.h>
- #define HI 6
- #define LO 1
-
-
- void main()
- {
- int rand_no;
-
- srand(time(NULL));
-
- rand_no=(rand() % HI)+LO;
- }
-
- This generates a random number between HI and LO every time the program is run.
- (Doesn`t do anything with it bet generates it anyway :-)<-<)
-
- --
- ********************************************************************************
- pcallagh@cs.strath.ac.uk
- Paul Callaghan :- Second Year Computer Science and Avid Scheme Hater.
-
- Microsoft:- Windows 2050, This time We've got it right.
- Microsoft:- Windows 95, Bugs????? No they`re undocumented features
- That`s half the FUN part.
- Pink Floyd:- "Shine On You Crazy Diamond."
- Me:- "AAAAAAAAAARRRRRRRRRRRGGGGGGGGGGHHHHHHHHHHHH!"
-
- ********************************************************************************
-
-